Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PLATY-62: Updated reportAProblem to reattach form validation after a successful submission #863

Merged
merged 3 commits into from
Nov 22, 2017
Merged

Conversation

JoPintoPaul
Copy link
Contributor

@JoPintoPaul JoPintoPaul commented Nov 21, 2017

Problem

If the reportAProblem form validation passes client-side but fails on the server, the result of the ajax call is another form which replaces the existing one. The submit event handler isn't attached to the replacement form though so when it's submitted, it redirects without the CSRF token.

Solution

Call the function to attach the submit event handler after a successful ajax request in case it's a form.

@rpowis
Copy link
Contributor

rpowis commented Nov 21, 2017

thanks @JoPintoPaul. can you add an entry to the Unreleased section of the CHANGELOG.md file that links to this PR please? you can follow the existing entries in that file

@JoPintoPaul
Copy link
Contributor Author

@rpowis Changelog updated.

@rpowis rpowis changed the title PLATY-62: Updated reportAProblem to reattach form validation after a … PLATY-62: Updated reportAProblem to reattach form validation after a successful submission Nov 21, 2017
@rpowis
Copy link
Contributor

rpowis commented Nov 21, 2017

@JoPintoPaul almost 😄 just missing the url to the PR. i've added it for you. i also took the liberty of updating the PR description 👍

@rpowis rpowis merged commit 59457b7 into hmrc:master Nov 22, 2017
hmrc-web-operations pushed a commit that referenced this pull request Nov 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants